package com.magold.game.level;

import com.magold.time.AccurateTime;

public class UpdateLog {
	private final AccurateTime time1;
	private final float rate1;
	private final AccurateTime time2;
	private final float rate2;
	
	private boolean needUpdateTime;
	private boolean needUpdateRate;
	
	public UpdateLog(AccurateTime minTime, float maxCoinRate, AccurateTime newTime, float newCoinRate) {
		time1 = minTime;
		rate1 = maxCoinRate;
		time2 = newTime;
		rate2 = newCoinRate;
		
		needUpdateTime = minTime.isLonger(newTime);
		needUpdateRate = maxCoinRate < newCoinRate;
	}
	
	public AccurateTime getLastRecordTime() {
		return time1;
	}

	public float getLastRecordRate() {
		return rate1;
	}

	public AccurateTime getNewTime() {
		return time2;
	}

	public float getNewRate() {
		return rate2;
	}
	
	public boolean needUpdateTime() {
		return needUpdateTime;
	}
	
	public boolean needUpdateRate() {
		return needUpdateRate;
	}
	
	public boolean needUpdate() {
		return needUpdateRate || needUpdateTime;
	}
	
}
